﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VM.Common.ConfigUntil
{
    public class ConfigProUntil
    {

        /// <summary>
        ///  configuration["AppSettings:UserName"];2
        /// </summary>
        /// <param name="Key"></param>
        public static string  GetConfigValuesByKey(string Key) {

            IConfiguration configuration = new ConfigurationBuilder()
                                        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
                                        .Build();

            string ResStr = configuration[Key];
            return ResStr;

        }
      

    }
}
